package com.bwhx.eruler.service.casdilly.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bwhx.eruler.bean.Page;
import com.bwhx.eruler.bean.casdilly.ClothesTypeExport;
import com.bwhx.eruler.bean.casdilly.ClothesTypeModelData;
import com.bwhx.eruler.dao.casdilly.IClothesTypeModelDataDAO;
import com.bwhx.eruler.service.casdilly.IClothesTypeModelDataService;
@Service
public class ClothesTypeModelDataServiceImp implements IClothesTypeModelDataService {
	@Autowired
	public IClothesTypeModelDataDAO modeldata;

	public boolean insertClothesTypeModelDatas(List<ClothesTypeModelData> typeModeldatas) {
		boolean bool = false;
		if (typeModeldatas != null && typeModeldatas.size() > 0) {
			bool = modeldata.deleteClothesTypeModelDataByTypeId(typeModeldatas.get(0));
			if (bool) {
				bool = modeldata.insertClothesTypeModelDatas(typeModeldatas);
			}
		}
		return bool;
	}

	public List<ClothesTypeModelData> queryClothesTypeModelDataByTypeIdModelAndSex(ClothesTypeModelData modelData) {
		return modeldata.queryClothesTypeModelDataByTypeIdModelAndSex(modelData);		
	}

	@Override
	public List<ClothesTypeModelData> list(Page entity) {
		return modeldata.list(entity);
	}

	@Override
	public Integer count(ClothesTypeModelData entity) {
		return modeldata.count(entity);
	}

	@Override
	public void insert(ClothesTypeModelData entity) {
		modeldata.insert(entity);		
	}

	@Override
	public void update(ClothesTypeModelData entity) {
		modeldata.update(entity);		
	}

	@Override
	public void delete(ClothesTypeModelData entity) {
		modeldata.delete(entity);		
	}

	@Override
	/**
	 * 根据品类名称获取该品类下的所有号型数据
	 * @param typeName 品类名称
	 * @return 号型数据
	 */
	
	public List<ClothesTypeModelData> queryClothesTypeModelDataByTypeName(String typeName) {
		return modeldata.queryClothesTypeModelDataByTypeName(typeName);
	}

	@Override
	public boolean deleteClothesTypeModelDatas(ClothesTypeModelData modelData) {
		boolean bool = false;
		bool = modeldata.deleteClothesTypeModelDataByTypeId(modelData);
		return bool;
	}


	

}
